#ifndef ADC_H
#define ADC_H

#include "stdint.h"

// Filter window size (number of samples for moving average)
#define FILTER_WINDOW_SIZE 10

// Raw ADC conversion results (2 channels)
extern uint16_t g_ad_value[2];

// Filtered ADC values (2 channels)
extern uint16_t g_ad_filtered_value[2];

/**
 * @brief Initialize ADC module (ADC1+DMA1, dual-channel acquisition)
 * @note Configure PA3 (channel 3) and PA4 (channel 4) as analog inputs, start continuous conversion
 */
void ad_init(void);

/**
 * @brief Apply sliding average filter to ADC conversion results
 * @note Process raw values of 2 channels separately, results stored in g_ad_filtered_value
 */
void ad_filter_process(void);

#endif // __ADC_H__
